package com.schoolcloud.social.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolcloud.common.model.PageDTO;
import com.schoolcloud.social.entity.SocEventRemark;
import com.schoolcloud.social.query.EventQuery;
import com.schoolcloud.social.query.EventRemarkQuery;
import com.schoolcloud.social.service.SocEventRemarkService;
import com.schoolcloud.social.mapper.SocEventRemarkMapper;
import com.schoolcolud.daomybatisplus.dto.MpPageUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author hongmizfb
* @description 针对表【soc_event_remark(活动评论表)】的数据库操作Service实现
* @createDate 2025-03-08 19:55:52
*/
@Service
public class SocEventRemarkServiceImpl extends ServiceImpl<SocEventRemarkMapper, SocEventRemark>
    implements SocEventRemarkService{

    @Override
    public List<SocEventRemark> getListOnlyRemarkByEventId(String eventId) {
        return lambdaQuery().eq(SocEventRemark::getEventId, eventId).list();
    }

    @Override
    public PageDTO<SocEventRemark> getEventRemarkPage(EventRemarkQuery query) {
        Page<SocEventRemark> page = lambdaQuery().eq(SocEventRemark::getEventId, query.getEventId()).page(query.toMpPage());
        return MpPageUtil.of(page, SocEventRemark.class);
    }
}




